package com.fesine.ch02.t7;

/**
 * @Author: Fesine
 * @CreateDate:2016/6/30
 * @UpdateUser:修改人名称
 * @UpdateDate:2016/6/30
 * @UpdateRemark:修改具体的内容
 */
public class Task {
    public void doLongTimeTask() {
        for (int i = 0; i < 100; i++) {
            System.out.println("nosynchronized threadName="+Thread.currentThread().getName()
                    +" i="+(i+1));
        }
        System.out.println("");
        synchronized (this) {
            for (int i = 0; i < 100; i++) {
                System.out.println("synchronized threadName=" + Thread.currentThread().getName()
                        + " i=" + (i + 1));
            }
        }
    }
}
